package com.mybatis_puls.demo.controller;


import com.mybatis_puls.demo.entity.Cate;
import com.mybatis_puls.demo.service.CateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小🌤
 * @since 2020-12-18
 */
@RestController
@RequestMapping("/cate")
public class CateController {
 @Autowired
    private CateService cateService;

    /**
     * 获取全部的分类
     * @return
     */
   @RequestMapping("/list")
    public Object list (){
       List<Cate> list = cateService.list();
    return list;
   }

}

